﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Plan2Detail.aspx.cs" Inherits="Manage_Emp2_Plan2Detail" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
     <script type="text/javascript">
         function checkForm() {
             var control = document.getElementById("txttitle");
             if (control.value.length == 0) {
                 alert("标题不能为空！");
                 control.focus();
                 return false;
             }

         }
         function checkOpenTimeAndCenter() {
             var period = document.getElementById("txtOpenTime");
             var center = document.getElementById("ddlcenter");
             var reg = /^([2-9]\d{3})(0[1-9]|1[0-2])$/;
             if (period.value.length == 0) {
                 alert("开课时间不能为空！")
                 period.focus();
                 return false;
             }
             if (!reg.test(period.value)) {
                 alert("开课时间格式不正确，正确的格式形如：201206！")
                 period.focus();
                 return false;
             }
             if (center.value == 0) {
                 alert("请选择所属指挥中心！")
                 center.focus();
                 return false;
             }
         }
  </script>
    <link rel="stylesheet" type="text/css" href="../skin/css/base.css" />
    <style type="text/css">
        .style1
        {
            width: 130px;
        }
        .style2
        {
            width: 242px;
        }
        .style3
        {
            width: 47px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"  EnableScriptGlobalization="True" EnableScriptLocalization="True">
        </asp:ScriptManager>
         <asp:UpdatePanel ID="up1" runat="server" >
    <ContentTemplate>
     <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center" >
        <tr>
            <td height="26" background="../skin/images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="center"><span style="font-size:14px; font-weight:bold">计划课程开设记录详细信息</span></td>
                        <td  align="right"  style="width:60px">
                        <asp:Button ID="btnreturn" class="coolbg_add" runat="server" Text="返回列表" 
                                onclick="btnreturn_Click"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
     
       <!--  提交 -->
      <table id="tbladdClassRecord"  runat="server" width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px;">
       <tbody style="width:100%">
               
        <tr align='center' style="width:100%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';" height="22" >
          <td width="13%" align="left">编号(自动编号)：</td>
           <td width="15%" align="left">
              <asp:Label ID="lblNum" runat="server"></asp:Label>
            </td>
            <td width="13%" align="left">标题：</td>
           <td width="35%" align="left">
             <asp:TextBox ID="txttitle" runat="server" Width="250px"></asp:TextBox>
            </td>
          <td width="24%" align="left" colspan="3"><asp:Button ID="btnSave" runat="server" Text="保存" OnClientClick="return checkForm();false" onclick="btnsave_Click" /></td>
         
        </tr>
      </tbody> 
      </table>
     <table width="98%" border="0" cellpadding="2" cellspacing="1"  align="center" style="margin-top:8px">
   
    <tr  style="border-bottom:none">
	    <td height="24" style=" text-align:right"> 
            <asp:Button ID="btnAddClass" runat="server" Text="添加计划课程开设记录" 
                onclick="btnAddClass_Click" />
                <asp:HiddenField ID="hdfeditflag" runat="server" Value="0" />
        </td>
    </tr>
    </table>
     <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
     <asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
   <ContentTemplate>
    <tr bgcolor="#E7E7E7" style="border-bottom:none">
	    <td height="24"  background="../skin/images/tbg.gif">&nbsp;计划课程开设记录列表
        <asp:FileUpload ID="fuExcel" runat="server" ToolTip="选择Excel文件" Height="18px" 
                        Width="381px"  Visible="false" />
                    &nbsp;&nbsp;
                    <asp:Button class="coolbg" ID="btnInput"  
                        runat="server" Text="从Excel导入" onclick="btnInput_Click" Visible="false"   />&nbsp;&nbsp;  <a href='<%=ConfigHelper.ExcelModelPath+"计划课程开设记录.xls" %>' target="_blank" style=" visibility:hidden" >查看Excel模板</a>
        </td>
    </tr>
     </ContentTemplate>
     <Triggers><asp:PostBackTrigger ControlID="btnInput" />
     </Triggers>
   </asp:UpdatePanel>
    <tr style="background-color:#ffffff">
    <td >
          <asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="4" BorderColor="#D1DDAA"  
                            AutoGenerateColumns="False" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                            OnRowEditing="GridView1_RowEditing" 
              OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting"
                            DataKeyNames="RecordId"   SelectedIndex="0" 
              OnRowDataBound="GridView1_RowDataBound" GridLines="Both" 
              AllowPaging="False" PageIndex="1" AllowSorting="true" 
              onsorting="GridView1_Sorting" onrowcommand="GridView1_RowCommand"  >
                            <Columns>
                                <%--<asp:TemplateField HeaderText="选择" >
                                    <ItemTemplate>
                                          <asp:CheckBox ID="chkID1" runat="server" />
                                          <asp:HiddenField ID="hdfRecordId" runat="server" Value='<%#Eval("RecordId") %>' />
                                    </ItemTemplate>
                                    
                                    <ItemStyle width="40px" HorizontalAlign="Center"  />
                                </asp:TemplateField>--%>
                                 <asp:TemplateField HeaderText="选择按钮" >
                                    <ItemTemplate>
                                       <asp:LinkButton ID="lbtnSCustomer" runat="server" Enabled="false"  Text="选择客户" CommandName="selCustomer" CommandArgument='<%#Eval("RecordId") %>'></asp:LinkButton>
                                       &nbsp;&nbsp;
                                       <asp:HiddenField ID="hdfRecordId" runat="server" Value='<%#Eval("RecordId") %>' />
                                       <asp:LinkButton ID="lbtnSClass" runat="server"  Enabled="false"  Text="选择课程" CommandName="selClass" CommandArgument='<%#Eval("RecordId") %>'></asp:LinkButton>
                                    </ItemTemplate>
                                  
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="所属指挥中心" SortExpression="CenterName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCenterName" runat="server" Text='<%# Eval("CenterName") %>'></asp:Label>
                                         <asp:HiddenField ID="hdfcenterId" runat="server"  Value='<%#Eval("CenterId") %>'/>
                                    </ItemTemplate>
                                  
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="客户编号" SortExpression="CustomerCode">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCustomerCode" runat="server" Text='<%# Eval("CustomerCode") %>'></asp:Label>
                                        <asp:HiddenField ID="hdfCustomerId" runat="server" Value='<%#Eval("CustomerId") %>' />
                                     </ItemTemplate> 
                                </asp:TemplateField>
                               
                                <asp:TemplateField HeaderText="客户名称" SortExpression="CustomerName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCustomerName" runat="server" Text='<%# Eval("CustomerName") %>'></asp:Label>
                                        
                                    </ItemTemplate>
                               </asp:TemplateField>
                                <asp:TemplateField HeaderText="职级" SortExpression="GradeName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblGradeName" runat="server" Text='<%# Eval("GradeName") %>'></asp:Label>
                                        <asp:HiddenField ID="hdfGradeId" runat="server" Value='<%#Eval("GradeId") %>' />
                                    </ItemTemplate>
                                     <EditItemTemplate>
                                       <asp:HiddenField ID="hdfGradeId" runat="server" Value='<%#Eval("GradeId") %>' /> <asp:DropDownList ID="ddlGrade" runat="server" ></asp:DropDownList>
                                    </EditItemTemplate>
                               </asp:TemplateField>
                                 <asp:TemplateField HeaderText="课程类型" SortExpression="ClassTypeName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblClassTypeName" runat="server" Text='<%# Eval("ClassTypeName") %>'></asp:Label>
                                    </ItemTemplate>
                                    
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="课程编号" SortExpression="ClassCode">
                                    <ItemTemplate>
                                        <asp:Label ID="lblClassCode" runat="server" Text='<%# Eval("ClassCode") %>'></asp:Label>
                                        <asp:HiddenField ID="hdfClassId" runat="server" Value='<%#Eval("ClassId") %>' />
                                    </ItemTemplate>
                                     
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="课程名称" SortExpression="ClassName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblClassName" runat="server" Text='<%# Eval("ClassName") %>'></asp:Label>
                                    </ItemTemplate>
                                     
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="课程小时数" SortExpression="Time">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTime" runat="server" Text='<%# Eval("Time") %>'></asp:Label>
                                    </ItemTemplate>
                                     <EditItemTemplate>
                                        <asp:TextBox ID="txtTime" runat="server" Text='<%# Eval("Time") %>' ></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="计划培训人次" SortExpression="PlanTimes">
                                    <ItemTemplate>
                                        <asp:Label ID="lblPlanTimes" runat="server" Text='<%# Eval("PlanTimes") %>'></asp:Label>
                                       
                                    </ItemTemplate>
                                     <EditItemTemplate>
                                        <asp:TextBox ID="txtPlanTimes" runat="server" Text='<%# Eval("PlanTimes") %>' ></asp:TextBox>
                                        <asp:HiddenField ID="hdfFactTimes" runat="server" Value='<%#Eval("FactTimes") %>' />
                                        <asp:HiddenField ID="hdfOpenTime" runat="server" Value='<%#Eval("OpenTime") %>' />
                                        <asp:HiddenField ID="hdfTeacherName" runat="server" Value='<%#Eval("TeacherName") %>' />
                                      
                                    </EditItemTemplate>
                                </asp:TemplateField>
								
                                <asp:CommandField   HeaderText="操作" ItemStyle-HorizontalAlign="Center" />
                                
                            </Columns>
                             <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#FFFFFF"  ForeColor="#000000" />
                            <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#FCFDEE" />
                            <SelectedRowStyle BackColor="#FFFFFF"  ForeColor="#000000" />
                            <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#FCFDEE"  ForeColor="000000" />
                            <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                                            </asp:GridView>
      </td>
   </tr>
   <%--  <tr bgcolor="#FAFAF1">
    <td height="28"  style=" padding-left:14px">
	    <asp:CheckBox ID="selectAll1" runat="server" Enabled="false"  Text="全选" 
            oncheckedchanged="selectAll1_CheckedChanged" AutoPostBack="true" />&nbsp;
          <asp:Button class="coolbg" ID="Button1" Enabled="false" OnClientClick="return confirm('你确定要删除选择课程吗?');" runat="server"
                          Text="批量删除"  OnClick="btnDeleteMass_Click"/>
    </td>
    </tr>--%>
    </table>
    <div id="floatBoxBg1" runat="server" visible="false" style="width:100%;height:100%;background:#000;filter:alpha(opacity=50);opacity:0.5;position:absolute;top:0;left:0; z-index:10000"></div>
     <div  id="divSCustomer" runat="server"  visible="false" style="border:#ccc 2px solid;position:absolute;top:20%;left:20%; z-index:10000;width:600px; height:400px; overflow:auto; background-color:#eee">  
     <div style="height:25px;padding:0; margin:0;background:#D1DDAA;color:#000; width:100%;"><div style="float:left; color:#000; font-size:14px; font-weight:bold; width:565px">客户选择对话框</div><span>
         <asp:ImageButton ID="ibtncloseCustomerSelect" runat="server"  
             ImageUrl="../skin/images/frame/btn_close.gif" 
             onclick="ibtncloseCustomerSelect_Click"/></span></div>
                 <table width='98%'  border='0' cellpadding='1' cellspacing='1' bgcolor='#CBD8AC' align="center" style="margin-top:8px">
              <tr bgcolor='#EEF4EA'>
                <td background='skin/images/wbg.gif' align='center'>
                  <table border='0' cellpadding='0' cellspacing='0'>
                    <tr>
                    <td width='70'>
                      关键字：
                    </td>
                    <td width='160'>
                        <asp:TextBox ID="txtkeyword" runat="server" Width="150px"></asp:TextBox>
                    </td>
                     
                    <td width="100px">
                        <asp:ImageButton ID="ibtnsearch" runat="server" Width="45px" Height="20px" 
                            BorderStyle="None"  CssClass="np"  ImageUrl="../skin/images/frame/search.gif" 
                            onclick="ibtnsearch_Click"  />
                     
                    </td>
                      
                    <td>
              
                    </td>
                   </tr>
                  </table>
                </td>
              </tr>
            </table>
    <div  style=" height:300px; overflow:auto">     
    <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
     <tr bgcolor="#E7E7E7" style="border-bottom:none">
	    <td height="24"  background="../skin/images/tbg.gif">客户列表 </td>
    </tr>
     
    <tr style="background-color:#ffffff">
    <td >
          <asp:GridView ID="GridView2" runat="server" Width="100%" CellPadding="4" BorderColor="#D1DDAA"  
                            AutoGenerateColumns="False" 
                            DataKeyNames="CustomerId"  DataMember="Name" SelectedIndex="0" 
              OnRowDataBound="GridView2_RowDataBound" GridLines="Both" 
              AllowPaging="False" PageIndex="1" AllowSorting="true" 
              onsorting="GridView2_Sorting"  onrowcommand="GridView2_RowCommand" >
                            <Columns>
                                 <asp:TemplateField HeaderText="所属指挥中心" SortExpression="CenterName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblcentername" runat="server" Text='<%# Eval("CenterName") %>'></asp:Label>
                                        <asp:HiddenField ID="hidcenterId" runat="server"   Value='<%#Eval("CenterId") %>' />
                                    </ItemTemplate>
                                  
                                      <ItemStyle Width="20%" />
                                </asp:TemplateField>
								  <asp:TemplateField HeaderText="客户编号" SortExpression="Code">
                                    <ItemTemplate>
                                        <asp:Label ID="lblcode" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
                                    </ItemTemplate>
                                   
                                     <ItemStyle Width="20%" />
                                </asp:TemplateField>
								  <asp:TemplateField HeaderText="客户名称" SortExpression="Name">
                                    <ItemTemplate>
                                        <asp:Label ID="lblname" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                    </ItemTemplate>
                                   
                                     <ItemStyle Width="20%" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                       <asp:LinkButton runat="server" ID="lbtEdit" CommandArgument='<%#Eval("CustomerId")%>'
                                    CommandName="sel" Text="选择"  ></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center"  Width="40px" />
                                    <HeaderStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#FFFFFF" ForeColor="#000000" />
                            <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#FCFDEE" />
                            <SelectedRowStyle BackColor="#FFFFFF"  ForeColor="#000000" />
                            <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#FCFDEE"  ForeColor="000000" />
                            <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                            
                        </asp:GridView>
       </td>
       </table>
       </div>
       </tr>
            <div style="height:36px; background-color:#EEF4EA; text-align:center">         <webdiyer:AspNetPager ID="pager1" runat="server" OnPageChanged="pager1_PageChanged"
                        PageSize="8">
                    </webdiyer:AspNetPager>
               </div>
     
  </div>
   <div id="floatBoxBg2" runat="server" visible="false" style="width:100%;height:100%;background:#000;filter:alpha(opacity=50);opacity:0.5;position:absolute;top:0;left:0; z-index:10000"></div>
     <div  id="divSClass" runat="server"  visible="false" style="border:#ccc 2px solid;position:absolute;top:20%;left:20%; z-index:10000;width:600px; height:400px; overflow:auto; background-color:#eee">  
     <div style="height:25px;padding:0; margin:0;background:#D1DDAA;color:#000; width:100%;"><div style="float:left; color:#000; font-size:14px; font-weight:bold; width:545px">课程选择对话框</div><span>
         <asp:ImageButton ID="ibtncloseClassSelect" runat="server"  
             ImageUrl="../skin/images/frame/btn_close.gif" 
             onclick="ibtncloseClassSelect_Click" /></span></div>
            <table width='98%'  border='0' cellpadding='1' cellspacing='1' bgcolor='#CBD8AC' align="center" style="margin-top:8px">
              <tr bgcolor='#EEF4EA'>
                <td background='skin/images/wbg.gif' align='center'>
                  <table border='0' cellpadding='0' cellspacing='0' align='center'>
                    <tr>
                    <td width='70'>
                      关键字：
                    </td>
                    <td width='160'>
                        <asp:TextBox ID="txtkey" runat="server" Width="150px"></asp:TextBox>
                    </td>
                     
                    <td width="100px">
                <asp:ImageButton ID="ibtnSearchClass" runat="server" Width="45px" Height="20px" 
                            BorderStyle="None"  CssClass="np"  ImageUrl="../skin/images/frame/search.gif" 
                            onclick="ibtnSearchClass_Click"  />
                     
                    </td>
                   </tr>
                  </table>
                </td>
              </tr>
            </table>
 
   
    <div  style=" height:300px; overflow:auto">
    <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
   
    <tr bgcolor="#E7E7E7">
	    <td height="24"  background="../skin/images/tbg.gif">课程列表
       </td>               
    </tr>
     
   <tr style="background-color:#ffffff">
    <td >
          <asp:GridView ID="GridView3" runat="server" Width="100%" CellPadding="4" BorderColor="#D1DDAA"  
                            AutoGenerateColumns="False" 
                            DataKeyNames="ClassId"  DataMember="Name" SelectedIndex="0" 
              OnRowDataBound="GridView3_RowDataBound" GridLines="Both" 
              AllowPaging="False" PageIndex="1" AllowSorting="true" 
              onsorting="GridView3_Sorting" onrowcommand="GridView3_RowCommand" 
           
              >
                            <Columns>
                                
                                 <asp:TemplateField HeaderText="课程编号" SortExpression="Code">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCode" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
                                    </ItemTemplate>
                                  
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="课程类型" SortExpression="ClassTypeName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTypename" runat="server" Text='<%# Eval("ClassTypeName") %>'></asp:Label>
                                        <asp:HiddenField ID="hidTypeId" runat="server" Value='<%#Eval("ClassTypeId") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                               
                                <asp:TemplateField HeaderText="课程名称" SortExpression="Name">
                                    <ItemTemplate>
                                        <asp:Label ID="lblname" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="课程小时数" >
                                    <ItemTemplate>
                                        <asp:Label ID="lblTime" runat="server" Text='<%# Eval("Time") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="是否启用" >
                                    <ItemTemplate>
                                        <asp:Label ID="lblIsValid" runat="server" Text='<%# Eval("IsValidDesc") %>'></asp:Label>
                                        <asp:HiddenField ID="hdfIsValid" runat="server" Value='<%# Eval("IsValid") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                       <asp:LinkButton runat="server" ID="lbtEdit" CommandArgument='<%#Eval("ClassId")%>'
                                    CommandName="sel" Text="选择"  ></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center"  Width="40px"/>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#FFFFFF"  ForeColor="#000000" />
                            <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#FCFDEE" />
                            <SelectedRowStyle BackColor="#FFFFFF"  ForeColor="#000000" />
                            <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#FCFDEE"  ForeColor="000000" />
                            <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                            
                        </asp:GridView>
       </td>
       </tr>
       </table>
       </div>
          <div style="height:36px; background-color:#EEF4EA; text-align:center">
                    <webdiyer:AspNetPager ID="pager2" runat="server" OnPageChanged="pager2_PageChanged"
                        PageSize="8">
                    </webdiyer:AspNetPager>
                
            </div>
    
    
     
  </div>
    </ContentTemplate>
     
    </asp:UpdatePanel> 
    </form>
</body>
</html>
